﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace QLVT
{
    class HoaDonDAL
    {
       
            public HoaDonDAL()
            { }
            public void ThemHoaDon(string sohd, string mahang, string diengiai,
                          double soluong, double dongia, double trigia, double khuyenmai)
            {
                SqlConnection conn = new SqlConnection();
                conn.ConnectionString = @"Data source=HUNGLE-PC\SQLEXPRESS;Initial Catalog=qlvt; User Id=sa; Password=sa";
                conn.Open();
                SqlCommand cmd = new SqlCommand("insert into hoadon values('" + sohd + "','" + mahang + "'," + soluong.ToString() + "," + dongia.ToString() + "," + trigia.ToString() + "," + khuyenmai.ToString() + ",N'" + diengiai + "') ", conn);
                cmd.ExecuteNonQuery();
                
            }
        
    }


}
